  <template>
      <div>
          <div class="top_class">
              <div class="left_work">
                  <img src="@/assets/icons/gzt1.png" style="width: 35px;height: 35px;" alt="Work Top Icon" />
                  <p>工作台</p>
              </div>
              <div class="right_work">
                  <el-select v-model="topTimeValue" placeholder="请选择" style="width: 100px;border: none">
                      <el-option v-for="(item, index) in topTime" :key="index" :label="item" :value="item"></el-option>
                  </el-select>
                  <el-icon :size="20">
                      <Setting />
                  </el-icon>
              </div>
          </div>
          <div class="top_card">
              <div v-for="(item, index) in topCardList" :key="index">
                  <p>{{ item.name }}</p>
                  <h1>{{ item.value }}</h1>
              </div>
          </div>
          <div class="second_card">
              <div class="warn_Box">
                  <div class="centenTop">
                      <p>提醒中心</p>
                      <el-tabs v-model="activeName" style="margin-top: 2%;padding-right: 5px;">
                          <el-tab-pane v-for="(item, index) in tabs" :key="index" :label="item"
                              :name="item"></el-tab-pane>
                      </el-tabs>
                  </div>
                  <div class="centenFoot">
                      <div v-for="(item, index) in centerList" :key="index">
                          <div>
                              <el-icon :size="25">
                                  <Bell />
                              </el-icon>
                              <p>{{ item.name }}</p>
                          </div>
                          <div>
                              {{ item.value }}
                          </div>
                      </div>
                  </div>
              </div>
              <div style="height: 60vh;margin-left: 10px;">
                  <div class="waitTop">
                      <p>待办中心</p>
                      <el-tabs v-model="waitTab" style="margin-top: 1%;">
                          <el-tab-pane v-for="(item, index) in waitTabs" :key="index" :label="item"
                              :name="item"></el-tab-pane>
                      </el-tabs>
                  </div>
                  <div class="Backloglist_box">
                      <div v-for=" item in 9">
                          <div class="waitFootTop">
                              <div>
                                  <img src="@/assets/icons/audio.png" alt="Work Top Icon" />
                              </div>
                              <div style="flex: 1;padding-left: 10px;">
                                  <div>有一条工作流需您审批，费用审批-活动经费报销</div>
                                  <div style="" class="backlogItem_box">
                                      <div>发起人:柳德焕</div>
                                      <div>2024-11-11 21:15</div>
                                  </div>
                              </div>
                          </div>
                      </div>
                  </div>
                  <div class="waitFootBottom">
                      <div>共16条</div>
                      <div>更多事项</div>
                  </div>
              </div>
          </div>
          <div class="top_class" style="margin-top: 10px">
              <div class="left_work" style="width:18%">
                  <img src="@/assets/icons/bt1.png" style="width: 30px;height: 30px;" alt="Work Top Icon" />
                  <p>常用仪表盘</p>
              </div>
              <div class="right_work" style="margin-right: 20px;width: 2px;">
                  <el-icon :size="20">
                      <Setting />
                  </el-icon>
              </div>
          </div>
          <div>
              <div style="background-color: white;margin-top: 20px;padding: 2%">
                  <charts-item-one style="width: 96%"></charts-item-one>
              </div>
              <div class="charts">
                  <div class="grid-item" style="padding: 1%">
                      <charts-item-two style="height: 100%"></charts-item-two>
                  </div>
                  <div class="grid-item" style="padding: 1%">
                      <charts-item-there></charts-item-there>
                  </div>
                  <div class="grid-item">
                      <charts-item-four></charts-item-four>
                  </div>
                  <div class="grid-item">
                      <charts-item-five></charts-item-five>
                  </div>
              </div>
          </div>
      </div>
  </template>

  <script setup lang="ts">
  import { reactive } from 'vue'
  import { Setting, Bell } from '@element-plus/icons-vue'
  import chartsItemOne from '@/components/workbench/chartsItemOne.vue'
  import chartsItemTwo from '@/components/workbench/chartsItemTwo.vue'
  import chartsItemThere from '@/components/workbench/chartsItemThere.vue'
  import chartsItemFour from '@/components/workbench/chartsItemFour.vue'
  import chartsItemFive from '@/components/workbench/chartsItemFive.vue'

  // 定义响应式数组 topTime，包含各时间选项
  const topTime = reactive<string[]>(['本周', '本月', '本季度', '今年', '上月', '去年'])
  // 定义 topTimeValue，初始化为 '本周'，与 topTime 数组中的一项匹配
  const topTimeValue = ref<string>('本周')
  //定义响应式数剧
  const activeName = ref('商机')
  //定义响应式数剧
  const waitTab = ref('待处理')
  // dingyitypeCard数组类型
  type topcard = {
      name: string;
      value: string;
  }
  // 定义响应式数组 topCard，包含各卡片信息
  const topCardList = reactive<topcard[]>([{ name: '新增线索', value: '12' },
  { name: '新增商机', value: '7' },
  { name: '新增客户', value: '26' },
  { name: '合同金额', value: '￥62,000.0' }, { name: '回款金额', value: '￥37,000.0' }])
  // 定义提醒中心tabs数组
  const tabs = reactive<string[]>(['商机', '客户', '合同'])
  // 定义待办中心tabs数组
  const waitTabs = reactive<string[]>(['待处理', '待阅'])
  //定义提醒列表数组
  const centerList = reactive<topcard[]>([{ name: '7天为未更新进展记录', value: '3' },
  { name: '12天为未更新进展记录', value: '7' },
  { name: '13天为未更新进展记录', value: '1' },
  { name: '12天为未更新进展记录', value: '7' },
  { name: '13天为未更新进展记录', value: '1' },
  { name: '14天为未更新进展记录', value: '2' }])

  </script>

  <style lang="scss" scoped>
  .top_class {
      background-color: white;
      width: 100%;
      height: 6vh;
      padding: 1%;
      display: flex;
      justify-content: space-between;

      div {
          display: flex;
          align-items: center;
          justify-content: space-between;

          p {
              font-size: 18px;
              font-weight: bold;
              color: black
          }

          img {
              width: 40px;
              height: 30px;
          }
      }
  }

  .right_work {
      width: 18%;
  }

  .left_work {
      width: 13%;
  }

  .top_card {
      margin-top: 2%;
      background-color: white;
      height: 13vh;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 1%;

      div {
          width: 19%;
          height: 100%;
          box-shadow: 5px 5px 10px rgba(91, 74, 74, 0.2);
          /* 外阴影 */
          border-radius: 5px;
          background-color: #409eff;
          background-size: 100% 100%;
          padding: 1.5%;
          color: white;
          display: flex;
          flex-direction: column;
          justify-content: space-between;

          h1 {
              font-size: 24px;
          }
      }
  }

  .second_card {
      margin-top: 2%;
      width: 100%;

      display: flex;
      justify-content: space-between;

      &> :first-child {
          width: 40%;
          background-color: #fff;
          color: #409eff;
          background-size: 100% 100%;
          padding: 2% 2% 2% 2%;
      }

      &> :last-child {
          background-color: white;
          width: 60%;
      }

      /* 提醒中心 */
      .warn_Box {
          display: flex;
          flex-direction: column;
          justify-content: center;
          height: 60vh;

          .centenTop {
              height: 10%;
              color: black;
              display: flex;
              align-items: center;
              justify-content: space-between;
              margin-bottom: 2%;

              p {
                  font-weight: bold;
                  font-size: 18px;
              }
          }

          .centenFoot {

              height: 350px;
              display: flex;

              flex-direction: column;
              overflow: hidden;

              >div {
                  background-color: #f2f2f2;
                  border-radius: 5px;
                  margin-bottom: 3%;
                  color: black;
                  display: flex;
                  height: 22%;
                  padding: 1% 3% 1% 4%;
                  justify-content: space-between;

                  &> :first-child {
                      display: flex;
                      flex-direction: column;
                      justify-content: space-around;
                  }

                  &>:last-child {
                      font-size: 40px;
                      margin-right: 4%;
                  }

              }

              >div:hover {
                  background-color: #ecf5ff;
                  border-radius: 5px;
                  margin-bottom: 3%;
                  color: black;
                  display: flex;
                  height: 22%;
                  padding: 1% 3% 1% 4%;
                  justify-content: space-between;

                  &> :first-child {
                      display: flex;
                      flex-direction: column;
                      justify-content: space-around;
                  }

                  &>:last-child {
                      font-size: 40px;
                      margin-right: 4%;
                  }
              }
          }
      }





      // 代办中心
      .waitTop {
          height: 50px;
          color: black;
          border-bottom: rgba(0, 0, 0, 0.2) solid 2px;
          display: flex;
          justify-content: space-between;
          align-items: center;
          padding: 5% 3% 3% 2%
      }

      .Backloglist_box {
          height: 350px;
          overflow: hidden;

          .waitFootTop {
              padding: 10px;
              display: flex;
              align-items: center;
              border-bottom: 1px #f2f2f2 solid;

              .backlogItem_box {
                  color: #adadad;
                  display: flex;
                  justify-content: space-between;
                  padding-top: 5px;
              }
          }

          .waitFootTop img {
              width: 40px;
              height: 40px;
          }
      }

      .centenFoot:hover {
          overflow: auto;
      }

      .centenFoot::-webkit-scrollbar {
          width: 0px;
          /* 设置滚动条宽度 */
          height: 5px;
          /* 设置水平滚动条高度 */
          opacity: 0;
          /* 初始状态下滚动条透明 */
          transition: opacity 0.3s;
          /* 滚动条显示时渐变 */
      }

      .Backloglist_box:hover {
          overflow: auto;
      }

      .Backloglist_box::-webkit-scrollbar {
          width: 0px;
          /* 设置滚动条宽度 */
          height: 5px;
          /* 设置水平滚动条高度 */
          opacity: 0;
          /* 初始状态下滚动条透明 */
          transition: opacity 0.3s;
          /* 滚动条显示时渐变 */
      }
  }

  .charts {
      display: flex;
      flex-wrap: wrap;
      /* 让元素换行 */
      gap: 10px;
      /* 元素之间的间距 */
  }

  .grid-item {
      flex: 1 1 calc(50% - 10px);
      /* 每个元素占 50% 宽度并考虑间距 */
      background-color: #f0f0f0;
      padding: 10px;
      box-sizing: border-box;
      text-align: center;
      background-color: white;
      margin-top: 10px;

  }

  .waitFootTop:hover {
      background-color: #f2f2f2;
      /* 整个元素的背景色变化 */
  }

  .waitFootBottom {
      border-top: 1px rgba(0, 0, 0, 0.1) solid;
      display: flex;
      justify-content: space-between;
      padding: 2%;

      &>:last-child {
          color: #409eff;
      }
  }

  :deep(.el-tabs__item) {
      color: black;
      opacity: 1;
  }

  /**选中 */
  :deep(.el-tabs__item.is-active) {
      color: #409eff;
      opacity: 1;
  }

  /**悬浮 */
  :deep(.el-tabs__item:hover) {
      color: #409eff;
      cursor: pointer;
      opacity: 1;
  }

  /* 去下划线 */
  :deep(.el-tabs__nav-wrap)::after {
      position: static !important;
  }

  /* 下划线颜色 */
  :deep(.el-tabs__active-bar) {
      background-color: #409eff;
  }

  .waitTop :deep(.el-tabs__item) {
      color: black;
      opacity: 1;
  }

  /**选中 */
  .waitTop :deep(.el-tabs__item.is-active) {
      color: #409eff;
      opacity: 1;
  }

  /**悬浮 */
  .waitTop :deep(.el-tabs__item:hover) {
      color: #409eff;
      cursor: pointer;
      opacity: 1;
  }

  /* 去下划线 */
  .waitTop :deep(.el-tabs__nav-wrap)::after {
      position: static !important;
  }

  /* 下划线颜色 */
  .waitTop :deep(.el-tabs__active-bar) {
      background-color: #409eff;
  }
  </style>
